var ws, spage, bell, lingbell;
document.addEventListener('plusready',function(){
	ws = plus.webview.currentWebview();
	spage = ws.spage;
	lingbell = ws.lingbell;//编辑页面传过来的铃声
	$('.mui-radio').each(function(){
		if(lingbell == $(this).find('label').text()){
			$(this).find('input').attr('checked' , 'checked');
		}
	}) 
	//选择铃声
	$('input[name=radio1]').click(function(){
		bell = $(this).siblings('label').text();
	})
	//点击完成
	$('#submit').on('click',function(){
		if(!bell){
			toast('您还未选择铃声');return;
		}
//		console.log(bell);
		var pid = plus.webview.getWebviewById(spage);
		mui.fire(pid, 'bell', {bell:bell});
		mui.back();
	})
},false);
function sound(obj){
	player('../audio/'+obj+'.mp3');
}  
function player(path){
	console.log(path);
	var player = plus.audio.createPlayer(path);
	player.play(function() {
		console.log("OK");
	}, function(e) {
		console.log(JSON.stringify(e.message))
	});
}